package ch5;

import java.util.Scanner;

public class Test0 {
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        double a, b, c;
        a = input.nextDouble();
        b = input.nextDouble();
        c = input.nextDouble();
        BankAccount amount = new BankAccount(a);
        System.out.println(amount.getBalance());
        amount.withdraw(b);
        System.out.println(amount.getBalance());
        amount.deposit(c);
        System.out.println(amount.getBalance());
    }
}

class BankAccount {
    double balance;

    public BankAccount() {
        balance = 0.0;
    }

    public BankAccount(double b) {
        if (b >= 0) {
            balance = b;
        } else {
            balance = 0.0;
        }
    }

    public double getBalance() {
        return balance;
    }

    public void deposit(double amount) {
        if (amount >= 0) {
            balance += amount;
        }
    }

    public void withdraw(double amount) {
        if (amount >= 0) {
            balance -= amount;
        }
    }
}
